@import "../../styles/variables";
@import "../../styles/mixins";

input.input {
  width: $input-default-width;
  height: 32px;
  padding: 6px 12px;
  border-radius: $border-radius;
  border: solid 1px $input-border-color;
  background-color: $input-bg-color;
  box-sizing: border-box;
  @include TypographySymbolText;
  transition: all $trans-speed ease-in-out;
  caret-color: $input-caret-color;
  outline: none;

  &::placeholder {
    font-weight: $font-normal;
    color: $input-placeholder-color;
  }

  &:not([readonly]):not([disabled]):hover {
    border-color: $input-hover-color;
  }

  &:not([readonly]):not([disabled]):focus {
    border-color: $input-focus-color;
    box-shadow: $input-focus-shadow;
  }

  &[readonly],
  &[disabled] {
    background-color: $input-disabled-color;
  }

  &[readonly] {
    cursor: initial;
  }

  &[disabled] {
    cursor: not-allowed;
  }
}

.input-password {
  position: relative;
  width: $input-default-width;

  &.has-icons-right {
    .icon.clickable {
      opacity: 0.5;
      pointer-events: auto;
      &:hover {
        opacity: 1;
      }
    }

    .icon.is-right {
      z-index: 5;
      @include vertical-center;
      right: 12px;
    }
  }
}

.input-search {
  position: relative;

  &.has-icons-left {
    .input {
      padding-left: 40px;
    }
    .icon.is-left {
      left: 12px;
    }
  }

  &.has-icons-right {
    .input {
      padding-right: 40px;
    }
    .icon.is-right {
      right: 12px;
    }
  }

  .icon {
    @include vertical-center;
    z-index: 4;
  }

  .input {
    width: 100%;
    border-radius: 18px;
    border-color: transparent;
    background-color: $input-search-bg;
    padding: 5px 12px;

    &:not([readonly]):not([disabled]):hover {
      border-color: $input-search-hover-border;
    }

    &:not([readonly]):not([disabled]):focus,
    &:not([readonly]):not([disabled]):active,
    &:not([readonly]):not([disabled]):visited {
      background-color: $input-search-hover-bg;
      border-color: $input-search-hover-border;
      box-shadow: none;
    }
  }
}
